package com.kgc.scd.service;

import com.kgc.scd.vo.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created On : 2022/11/16.
 * <p>
 * Author : Administrator
 * <p>
 * Description: OrderService
 */
@FeignClient(value = "wyyxmall-j-l-t-server")
public interface OrderService {

    @GetMapping("/getShopUser")
    ShopUserVO involveShopUserServerById(@RequestParam("userId") String userId);


    @GetMapping("/getShopAddressById")
    ShopAddressVO involveShopAddressServerById(@RequestParam("addressId") String addressId);


    @GetMapping("/getShopGoodsById")
    ShopGoodsVO involveShopGoodsServerById(@RequestParam("pid") String pid);

    @PostMapping("/createShopOrdertosave")
    @Async
    void involveShopOrderServer(ShopOrderVO shopOrderVO);

    @PostMapping("/createShopOrderitemtosave")
    @Async
    void involveSaveShopOrderitemServer(ShopOrderitemVO shopOrderitemVO);

    @GetMapping("/getShopOrderById")
    ShopOrderVO involveGetShopOrderById(@RequestParam("orderId") String orderId);

    @PostMapping("/updateShopOrder")
    @Async
    void involveUpdateShopOrderPrice(ShopOrderVO shopOrderVO);


    @GetMapping("/delOrderById")
    void involveDelShopOrderById(@RequestParam("orderId") String orderId);

    @GetMapping("/judegeGoodNumberEnough")
    boolean involveJudgeGoodsNumberEnough(@RequestParam("pid") String pid,@RequestParam("number") Integer number);
}
